<#include "../common/_layout.html" />
<@layout>
    <div class="row">
    	<div class="pull-left">
        	<form class="form-search" action="user/search">
        		<div class="input-append">
        		<input type="text" class="input-medium search-query" name="word" value="${word!}" placeholder="Search user">
        		<select name="scope" class="input-small">
                    <option value="">All</option>
                    <option value="name" <#if scope=="name">selected</#if>>Name</option>
                    <option value="nick" <#if scope=="nick">selected</#if>>Nick</option>
                    <option value="school" <#if scope=="school">selected</#if>>School</option>
                    <option value="email" <#if scope=="email">selected</#if>>Email</option>
    	        </select>
        		<button type="submit" class="btn">Search</button>
        		</div>
        	</form>
        </div>
        <div class="pull-right">
        	<span class="badge badge-info">${(userList?size)!0} Results</span>
        </div>
    </div>
    <div class="row">
    	<table id="user-list" class="table table-striped table-condensed">
            <thead>
              <tr>
                <th>No.</th>
                <th>User</th>
                <th>Nick Name</th>
                <th>School</th>
                <th>Solved</th>
                <th>Submit</th>
              </tr>
            </thead>
            <tbody>
            <#if userList??>
            <#list userList as User>
            <tr>
                <td>${User_index+1}</td>
                <td><a href="user/profile/${User.name!}">${User.name!}</a></td>
                <td>${User.nick!}</td>
                <td>${User.school!}</td>
                <td>${User.solved!}</td>
                <td>${User.submit!}</td>
            </tr>
            </#list>
            </#if>
            </tbody>
        </table>
	</div>

    <link rel="stylesheet" href="assets/tablecloth/css/tablecloth.css">
    <script src="assets/tablecloth/js/jquery.metadata.js"></script>
    <script src="assets/tablecloth/js/jquery.tablesorter.min.js"></script>
    <script src="assets/tablecloth/js/jquery.tablecloth.js"></script>

    <script type="text/javascript" charset="utf-8">
      $(document).ready(function() {
                
        $("#user-list").tablecloth({
          theme:"stats",
          condensed:true,
          sortable:true,
          striped:true,
          clean:true
        });
    });
    </script>

</@layout>